package com.yunhui.mapper;

import com.yunhui.entity.Merchant;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author WGH
 * @since 2019-12-09
 */
public interface MerchantMapper extends BaseMapper<Merchant> {
    /**
     * 查询用户是否存在，若是存在则提示已存在
     * @param name
     * @return
     */
    Merchant findMerchantNameByName(String name,String password);

    //public void insertMerchant(String account,String phone,String eamil,Integer status,String password,String imgUrl);
    /**
     * 注册
     * @param merchant
     * @return
     */
    public Merchant insertMerchant(Merchant merchant);

    Merchant findUserByName(@Param("account") String username);
    void regist(Merchant merchant);

    /**
     * 注册
     * @param account
     * @param phone
     * @param eamil
     * @param password
     * @return
     */
    int insertMerchant(@Param("account") String account, @Param("phone") String phone,
                       @Param("eamil") String eamil, @Param("createDate") Date createDate,
                       @Param("status") Integer status, @Param("password") String password);


    /**
     * 登录
     * @param account
     * @param password
     * @return
     */
    public Merchant userlogin(@Param("account") String account,@Param("password") String password);
}
